(a) Field of the Invention
This invention relates in general to optical character readers (OCR) and systems using OCRs. More specifically, the invention relates to OCR systems including a hand-held scanner device for reading printed characters.
(b) Description of the Prior Art
In supermarkets and department stores, Point of Sale (POS) systems are now extensively employed. At the time of a sale, sales data for each article sold is collected for stock control, accounting, or for other purposes. In a POS system, an OCR is often used to read data from a price tag or label attached to the articles sold. This data may include a code number identifying the item sold and the price of the article.
A hand-held OCR device of the general type shown in a portion of FIGS. 1 and 2 (FIG. 2 only is "prior art") has been proposed (Japanese Patent Application No. 79082/1985) and utilized. A scanner device 21 is manipulated by an operator's hand 22 so as to be placed against a sheet 23 having characters and symbols printed thereon. Sheet 23 is, for example, a price tag on which data used in the POS system, such as an article number and a price, have been provided, but the term could include anything on which information has been provided. The term "characters" as used herein is intended to mean alphanumeric characters including "digits", "symbols" and "alphabet". The OCR is not used to read "Kanji" (Chinese characters).
A light source 24 provided on the front end of scanner 21 emits a light beam. This light beam impinges on sheet 23 and is reflected therefrom, carrying optical information indicative of what is on the sheet. The reflected light is transmitted through a lens system 25 to a sensor 26. Sensor 26 is a two-dimensional image sensor which has a field of view that is substantially equal to the area of sheet 23 on which data has been written, i.e., a price tag. The light receiving section of sensor 26 includes photo-electric conversion elements arranged in a matrix.
In each of the photo-electric conversion elements, the intensity of light applied affects some electrical parameter such as, for example, current or resistance to provide an analog electrical signal having some value. That analog value is compared with a reference voltage to obtain a digital value. The electrical signal may be converted into a high bit digital data. However, it is, more preferably converted into a digital data having either of two discrete values, one corresponding to "light" and the other corresponding to "dark". Parts subjected to photo-electric conversion by the photo-electric conversion elements are referred to as "picture elements" (pixels), respectively. The picture elements are classified into two groups, light and dark groups which are represented by the values "0" and "1", respectively. More specifically, the picture elements having the value "0" are referred to as "white picture elements", and the picture elements having the value "1" are referred to as "black picture elements". The picture element is the minimum unitary region in the picture processing operation. The number of picture elements present depends on the sensor being used. The field of vision of the sensor images all data on the price tag. Scanner 21 can read all data provided on a price tag, which is in the field of vision, without moving across the price tag.
A control binary-coding circuit 27 compares the output signal of sensor 26, which is provided for every picture element, with a threshold value thereby to provide a binary-coded signal, which is supplied to an image memory 28.
Image memory 28 stores the binary-coded data of the picture elements which corresponds substantially to the entire field of vision of sensor 26. The binary-coded data of the sensor 26 will be described with reference to FIG. 3.
The sensor has p.times.q picture elements arranged in a matrix (p picture elements in each column and q picture element in each line). The area occupied by the p.times.q picture elements thus arranged corresponds to the area of the data part of the sheet 23.
The picture elements are arranged regularly horizontally and vertically. A series of picture elements arranged horizontally (in a line) is designated by reference characters B1, B2, . . . and Bq, respectively. Similarly, a series of picture elements arranged vertically, or in a column, will be designated by reference characters L1, L2 . . . and Lp, respectively.
All the picture elements can be specified by the line and column numbers. For example, the picture element at the intersection of the m-th line and the n-th column can be expressed as "picture element (m, n)".
Reference characters B1, B2, . . . and Bq designate the columns, respectively. For instance, reference character B1 designates all the picture elements arranged in the first column (the left most column). Similarly, reference characters L1, L2, . . . and Lp designate the lines, respectively. For example, reference character L1 designates all the picture elements arranged in the first line (or the top line).
For every picture element, the value "0" or "1" (hereinafter referred to merely as "0" or "1", when applicable) is stored in the image memory 28. Therefore, it may be considered that FIG. 3 represents the contents of the image memory 28. The data ("0" or "1") of the picture elements can be stored with the lines an columns (m,n) as addresses.
FIG. 3 shows the digits "1", "2", "3", "4" and "5" and the characters "A" and "B" by way of example. These digits and characters are the black picture elements of "1", the remaining region, where no digits and characters are provided, are the white picture elements of "0".
The digit "1" is located in the region defined by B1 through Bn and L1 through Lm; that is, the digit "1" is formed by the picture elements of m lines.times.n columns.
The other digits also are formed by the picture elements which are the same in area.
In the FIG. 2 arrangement an identifying section 30 operates to identify characters and symbols one-by-one.
The identifying section 30 does not employ a method in which the lines are successively scanned in such a manner that after the first line L1 is scanned, the second line L2 is scanned. Rather, it employs a method in which the group of picture elements forming a character are scanned and the data of the character are temporarily stored in a buffer register 8 for identification. That is, the identifying section 30 operates to read the data of a character out of the image memory.
A control circuit 29 reads data corresponding to (m.times.n) picture elements which can be processed by the identifying section 30 and feeds the data into the buffer register 8. Buffer register 8 is made up of (m.times.n) registers, the contents of which are compared with the picture element value distributions of the characters and symbols which have been known in advance, to determine what the character of symbol is.
Even in the case where (m.times.n) is so selected as to express a character or symbol, a character may come to the border of the area (m.times.n) depending on a method of taking the character. This difficulty can be overcome by a method in which the group of (m.times.n) picture elements is moved right as much as one column, or two or three columns, and each time the identification is carried out. The group of (m.times.n) picture elements for a character will be referred to as "an identification window", when applicable.
The identification window is moved right as much as one picture element column or a plurality of picture element columns to identify characters arranged in a line. Thereafter, the identification window is moved downward, and moved right in the same manner to identify characters on the second line. This operation is repeatedly carried out to read all the characters.
The character identifying operation will be described in more detail.
In FIG. 3, n data (B1 to Bn) of the line L1, n data (B1 to Bn) of the line Lm are read out of the image memory 28 and stored in the buffer register 8. That is, the data of the identification window defined by 31 through Bn and L1 through Lm are stored in the buffer register 8.
The feature data of characters and symbols each formed with (m.times.n) picture elements have been stored in an identifying circuit 12. In identifying circuit 12, it is determined whether or not input data coincide with the data stored therein. If the input data coincides with one of the reference data, then it is determined that the input data represents that character or symbol corresponding to the reference data to which the input data coincides.
Identification of characters and symbols by using the data stored in the buffer register 8 is as described above. This character identifying principle is well known in the art, being employed in Japanese Patent Application Publication No. 6418/1984.
Next, the identification window is shifted right by one column. That is, in the lines L1 through Lm, the data of (m.times.n) picture elements of the (B1+1)th to (Bn+1)th columns are transferred from the image memory 28 into the buffer register 8. In the identifying circuit 12, the data thus transferred are compared with those of the characters and symbols stored therein.
The identification window is shifted right by one column again. That is, in the lines L1 through Lm, the data of (m.times.n) picture elements of the (B1+1)th through (Bn+2)th columns are transferred from the image memory 28 into the buffer register 8. The operation of the identifying circuit 12 is repeated.
In the same manner, the identification window is shifted right from column to column until, in the lines L1 through Lm, the data of the Bq-th column is transferred into the buffer register 8. The above-descried scanning operation permits the identification of the characters and symbols arranged in one line.
In the above-described case, the identification window corresponding to (m.times.n) picture elements is moved right by one picture element column. As an alternative, it may be shifted by two or three picture element columns.
When the characters and symbols in the line have been identified, the identification window is moved downward; more specifically, it is moved downward as much as about the height of the character. For instance in the case where m lines correspond to about twice the height of the character, the identification window is moved downward as much as m/2 picture element lines. That is, in the Lm/2-th through 3Lm/2-th lines, the data of (m.times.n) picture elements of the B1-th through Bn-th columns are transferred into the buffer register 8 so as to be identified in the identifying circuit 12.
Next, in the Lm/2-th through 3Lm/2-th lines, the data of (m.times.n) picture elements of the (B1+1)th through (Bn+1)th columns are transferred into the buffer register 8 and subjected to the identification process carried out by identifying circuit 12. The above-described operations are repeatedly carried out.
In the case where the identification window is shifted by one picture element column at a time horizontally, the identification must be repeated (q-n+1) times per horizontal (line) scan. If p is a multiple of m/2, the identification must be performed (2p/m) times per vertical (column) scan. Therefore, the number of times of identification in total is: EQU [2p (c-n+1)]/m
All of the characters and symbols in the field of vision of the sensor 26 can be read through the above-described operation.
The conventional character reading device has some operational drawbacks:
Consider the operation of placing the scanner on a price tag. The actual "reading" of characters is achieved relatively rapidly once the scanner is placed against the price tag. The period of time during which the scanner is not "reading" is relatively long compared with the time during which it is reading. It takes a considerably longer time to move the scanner to and from the price tag than it does to do the actual reading. Most of the time, the scanner sits in its stand. During "nonreading" time, it is not necessary to go through the process of identification of characters and symbols.
In such idle periods of time, it is desirable to suspend the character identifying operation to conserve electric power. The scanner should perform its character identifying operation only when a line of characters on a price tag comes into the field of vision of the sensor in the scanner. At that time, the characters should be read correctly.
If a conventional OCR were so modified to read characters or symbols only when required, then electric power could be used more economically and the reliability of the scanner would be improved.
FIG. 4 shows an arrangement wherein a scanner scans vertically, as indicated by the arrow, a price tag with characters in a plurality of lines to read the characters. In this character reading operation, sometimes there is a train of characters to be read horizontally, and sometimes not.
In a price tag, a region having a train of character will be referred to as "a character region", and a region having no train of characters as "an empty region", when applicable.
In the case of FIG. 2, the scanner is held on the price tag for a period of time to read the characters and symbols which come in the field of vision. It is difficult for the OCR to read trains of characters arranged vertically. Even if it were possible to do so, it would take a relatively long period of time, because it operates for the empty region in the same manner as for the character region. Therefore, it is desirable that the scanner discriminate the character region from the empty region and it is appropriate to consider means for detecting whether or not there is a line of characters in the field of vision of the scanner; i.e., means for detecting whether or not there is a character region in the field of vision of the scanner.
FIG. 5 shows a case in which there are characters in the field of vision. The field of vision is of 320 picture elements (in the "line" direction or horizontally).times.60 picture elements (in the "column" direction or vertically). On the original, both an image pitch in the "line" direction and an image pitch in the "column" direction are 0.19 mm, and the field of vision is therefore 60.8 mm.times.11.4 mm.
In the upper left portion of FIG. 5, straight lines are described along four sides of each picture element to show the picture elements. Parts of characters are shown at the top of the upper left portion of Figures, and complete characters are shown at the bottom of the upper left portion of FIG. 5. There are not characters between the "parts of characters" and the "complete" characters. There are only white picture elements between the two rows of characters.
The characters are arranged horizontally, and made up of the black picture elements. Therefore, if it is detected whether the black picture element or elements are present in the horizontal direction (or in the "line" direction), then it can be determined whether character or characters are present in that direction.
In general, characters are arranged in the "line" direction to some length. Therefore, in detection of the black picture element or elements, it is not always necessary to scan the entire length of the line. The detection of the black picture element or elements can be achieved by scanning part of picture elements in the "line" direction. More specifically, a line in which at least one of W picture elements in the "line" direction is the black picture element, and a line in which none of the W picture elements are the black picture elements should be distinguished from each other.
A test range consisting of the W picture elements used for detecting the presence or absence of the black picture element will be referred to as "a horizontal OR range". The term "horizontal" of the "horizontal OR range" is based on the fact that the detection of the black picture element is made for a train of picture elements arranged in a "horizontal" direction. The term "OR" means an "OR" operation. When at least one of the W picture elements arranged in the horizontal direction is black, then the output is a logical level "1"; and when all the W picture elements are white, then the output is a logical level "0". This is essentially an "OR" operation.
Hereinafter, the operation of determining whether in the horizontal OR range, a group of picture elements in a line has at least one black picture element or not will be referred to as "a horizontal OR operation", when applicable.
By way of example, of the 320 picture elements in the "line" direction, 100 picture elements (50 picture elements on both sides of the center) will be the aforementioned "horizontal OR range"; that is, W=100 corresponding to 19 mm (in the horizontal direction) on the original.
The field of vision spreads as much as 60 picture elements in the vertical direction. Therefore, in this example, the "horizontal OR range" is a central rectangular region consisting of 6,000 (=100.times.60) picture elements. 110 picture elements on each side and 110 picture elements are provided on both sides of the rectangular region and they are not included in the horizontal OR range.
If, in the field of vision of the sensor, characters are not in the horizontal OR range, then the characters cannot be read. Therefore, the operator should place the scanner on the price tag in such a manner that the center of the scanner coincides with the center of a train of characters. In the case where a train of characters is longer than 100 picture elements, all that is required for the operator to handle the scanner is to allow the characters to come in the scanner's window.
In the character region, lines, the results of OR operation of which are "1", occur successively in the vertical direction. In the upper right portion of FIG. 5, reference character "L" designates the total width of vertically successive lines the results of OR operation of which are "1". The upper right portion of FIG. 5 indicates black picture element lines L.sub.1 in total width in the upper portion, and black picture element lines L.sub.2 in total width in the lower portion, which correspond to two trains of characters.
As is apparent from FIG. 5, the total width of black picture element lines corresponds to the height of characters. If the values L.sub.1 and L.sub.2 are suitable for the height of characters, then it can be determined that the characters are in the field of vision.
The total width L of black picture element lines is not always equal to the height of characters. That is, if the scanner is inclined with respect to characters, then L increases. When the "line" direction of the scanner is in parallel with the direction of arrangement of characters then L is minimum, and equal to the height of the characters.
Accordingly, it is essential to determine whether or not the value L.sub.1 or L.sub.2 is suitable for the height of characters. The minimum value suitable for the height of characters can be obtained when, as shown in FIG. 6(a), a character line is extended horizontally in the field of vision. The maximum value suitable for the height of characters can be obtained when, as shown in FIG. 6(b), a character line is inclined at a maximum allowable angle in the field of vision. Where the direction of the character line coincides with the "line" direction of the field of vision, L is about 2.4 mm because the height of characters is 2.4 mm. The maximum inclination angle of the character line with respect to the field of vision is 8 degrees. If, in the 19-mm horizontal OR range, the 2.4 mm high character line is inclined at 8 degrees, then L is about 5.9 mm. Thus, the value suitable for L is ranged from 2.4 mm to 5.9 mm, or 12 to 31 picture elements.
There are in use a wide variety of price tag shapes and sizes. It is desirable that an OCR be "universal" in that it is able to read any price tag or label information. However, the wide variety of price tags and labels presents a problem in determining the horizontal OR range.
Examples of a price tag will be described with reference to FIGS. 7(a)-7(e) which are price tags for POS system defined by JIS (Japanese Industrial Standard) B9551. FIG. 7(a) shows a POS-41 price tag and FIGS. 7(d) shows a POS-10 price tag.
FIG. 7(a) shows a POS-41 price tag which is 70 mm wide and 35 mm high. It has a first line of many digits at the middle level, and a second line of digits in the lower right region. In this case, not only the first line but also the second line located in the lower right region of the price tag must be detected. Therefore, the horizontal OR range should be 30.4 mm wide as shown in FIG. 7(b) corresponding to 160 picture elements. That is, the horizontal OR range is wider by 60% than that of 19 mm, or 100 picture elements shown in FIG. 6. With this wide horizontal OR range, the second line located in the lower right portion of the price tag can be detected as shown in the part (c) of FIG. 7.
FIG. 7(d) shows the POS-10 price tag which is 32 mm wide and 25 mm high. The scanner may be placed on the price tag as shown in FIG. 7(e). In this case, the price tag has a width of 32 mm, and the width of the horizontal OR range is 30.4 mm, as was described above.
If the operator places the scanner on the price tag with care, then the horizontal OR range can correctly cover the price tag (not sticking out of the price tag) as shown in FIG. 7(e). However, it is considerably difficult to do so, because of a small margin of 1.6 mm.
If the horizontal OR range sticks out of the price tag, then the background of the price tag comes in the horizontal OR range. The background of the price tag is not always white. If the background covered by the horizontal OR range is black, then the line under detection will be determined as a line including the black picture element or elements even when the portion of the price tag covered by the horizontal OR range is white. This is obviously an erroneous operation.
That is, the horizontal OR range should not stick out of the price tag. In the case of a small price tag, this requirement can be satisfied only when the person skilled in the operation of the OCR handles the scanner with care, because the margin is so small. To expect a person operating a register in a supermarket to do so is to ask too much of him. It is not practical to use an OCR that is troublesome to use.